using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace PEM
{
    public abstract class PersistentModalDialog : Window
    {
        public new bool DialogResult
        {
            get
            {
                return _dialogResult;
            }
            protected set
            {
                _dialogResult = value;
                base.DialogResult = value;
            }
        }

        public bool ShowDialog(Window owner)
        {
            Owner = owner;
            ShowDialog();

            return _dialogResult;
        }

        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            base.OnClosing(e);

            e.Cancel = true;
            Hide();
        }

        private bool _dialogResult;
    }
}
